<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAgentAppliesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('agent_applies', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('user_id')->default(0)->comment('用户id');
            $table->string('realname')->nullable()->default('')->comment('真实姓名');
            $table->string('id_card')->nullable()->default('')->comment('身份证号');
            $table->string('type')->nullable()->default('personal')->comment('代理人类型 personal：个人 enterprise：企业');
            $table->string('company_name')->nullable()->default('')->comment('单位名称');
            $table->string('unified_social_credit_code')->nullable()->default('')->comment('统一社会信用代码');
            $table->string('contacts_people')->nullable()->default('')->comment('联系人');
            $table->string('phone')->nullable()->default('')->comment('手机号');
            $table->tinyInteger('review')->default(0)->comment('审核状态 0：审核中 1：通过 2：拒绝');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('agent_applies');
    }
}
